using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class AddEnemy : MonoBehaviour
{
    public GameObject enemyPre;
    public void onAdd(Transform player)
    {
        if (enemyPre)
        {
            // 创建敌人对象并将其父对象设置为当前对象的 transform
            Enemy e = Instantiate(enemyPre, transform.position, transform.rotation).GetComponent<Enemy>();
            e.player = player;
        }
    }
}